home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / VCal / Utils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.1 KB  |  56 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifndef _UTILS_
  18. #define _UTILS_
  19.  
  20. #define DAYS_IN_WEEK        7
  21. #define MAX_DAYS        6*DAYS_IN_WEEK
  22. #define MINS_IN_HOUR        60
  23. #define MINS_IN_DAY        (MINS_IN_HOUR*24)
  24.  
  25. #define MAXSTR    1024
  26.  
  27. void formatTime(int hour, int min, int clock24, char *str_return);
  28. void formatShortTime(int hour, int min, char *str_return);
  29. void formatDate(int weekday, int day, int month, int year, char *str_return);
  30. void formatDate(int day, int month, int year, char *str_return);
  31. void formatDate(int month, int year, char *str_return);
  32. int readInt(FILE *fd, int *num);
  33. void writeInt(FILE *fd, int num, char *annotation = NULL);
  34. int readStr(FILE *fd, char *str_return);
  35. void writeStr(FILE *fd, char *str);
  36. int parseDate(char *str, int *day, int *month, int *year);
  37. int parseMonth(char *str, int *month, int *year);
  38. int compareDates(int day1, int month1, int year1,
  39.          int day2, int month2, int year2);
  40. int computeWeekday(int day, int month, int year);
  41. int computeDayDifference(int day1, int month1, int year1,
  42.              int day2, int month2, int year2);
  43. void augmentDate(int day, int month, int year, int days,
  44.          int *day_return, int *month_return, int *year_return);
  45. void decrementDate(int day, int month, int year, int days,
  46.            int *day_return, int *month_return, int *year_return);
  47. int matchMonthString(char *str);
  48. char *monthString(int month);
  49. char *weekdayString(int day);
  50.  
  51. int jan1(int year);
  52. int FirstDay(int month, int year);
  53. int NumberOfDays(int month, int year);
  54.  
  55. #endif
  56.